package com.naiterui.ehp.bs.b2c.order.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Version;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * <pre>
 *      订单退款表
 * </pre>
 *
 * @author 王泽浩
 * @date 2019-02-19 10:27
 * @since 1.0.0
 */
@Data
@Builder
@Entity
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "e_refund_order")
public class RefundOrder implements java.io.Serializable {

    private static final long serialVersionUID = -7005881775487424507L;

    /**
     * 数据删除标记  正常
     */
    public static final int DEL_FLAG_NO = 0;

    /**
     * 数据删除标记  删除
     */
    public static final int DEL_FLAG_YES = 1;

    /**
     * 退款状态 1: 待提交
     */
    public static final int STATUS_WAIT_SUBMIT = 1;
    /**
     * 退款状态 2: 待审核
     */
    public static final int STATUS_WAIT_AUDIT = 2;
    /**
     * 退款状态 3: 待付款
     */
    public static final int STATUS_WAIT_PAY = 3;
    /**
     * 退款状态 4: 已完成
     */
    public static final int STATUS_COMPLETE = 4;
    /**
     * 退款状态 5: 已作废
     */
    public static final int STATUS_INVALID = 5;

    /**
     * 主键
     */
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "id")
    private Long id;

    /**
     * 订单ID
     */
    @Column(name = "order_id")
    private Long orderId;

    /**
     * 订单号
     */
    @Column(name = "order_sn")
    private String orderSn;

    /**
     * 退款单号
     */
    @Column(name = "refund_order_sn")
    private String refundOrderSn;

    /**
     * 退款金额
     */
    @Column(name = "amount")
    private Integer amount;

    /**
     * 退款方式
     */
    @Column(name = "method")
    private Integer method;

    /**
     * 退款状态 1: 待提交 2: 待审核 3: 待付款 4: 已完成 5: 已作废
     */
    @Column(name = "status")
    private Integer status;

    /**
     * 审核时间
     */
    @Column(name = "audit_time")
    private Date auditTime;

    /**
     * 收款账号
     */
    @Column(name = "payment_account")
    private String paymentAccount;

    /**
     * 退款原因 1: 客户原因 2: 发货速度 3: 包装损坏 4: 包装不满 5: 发错商品 6: 发漏商品
     */
    @Column(name = "reason")
    private Integer reason;

    /**
     * 备注
     */
    @Column(name = "remark")
    private String remark;

    /**
     * 创建时间
     */
    @Column(name = "created_at")
    private Date createdAt;

    /**
     * 创建人
     */
    @Column(name = "created_by")
    private String createdBy;

    /**
     * 修改时间
     */
    @Column(name = "changed_at")
    private Date changedAt;

    /**
     * 修改人
     */
    @Column(name = "changed_by")
    private String changedBy;

    /**
     * 乐观锁
     */
    @Version
    private Integer version;

    @Column(name = "del_flag")
    private Integer delFlag;

}
